package com.wsj.service.impl;

import java.util.List;

import com.wsj.dao.IHomeSiteNewsTitleNewsDao;
import com.wsj.service.IHomeSiteNewsTitleNewsServ;
import com.wsj.util.exception.BusinessException;
import com.wsj.util.page.PageResultSet;
import com.wsj.web.form.HomeSiteNews.AdminNewsTitleNewsForm;
import com.wsj.web.vo.homeSite.HomeSiteNewsTitleNews;

public class HomeSiteNewsTitleNewsServImpl implements
		IHomeSiteNewsTitleNewsServ {
	
	private IHomeSiteNewsTitleNewsDao homeSiteNewsTitleNewsDao;
	

	public IHomeSiteNewsTitleNewsDao getHomeSiteNewsTitleNewsDao() {
		return homeSiteNewsTitleNewsDao;
	}

	public void setHomeSiteNewsTitleNewsDao(
			IHomeSiteNewsTitleNewsDao homeSiteNewsTitleNewsDao) {
		this.homeSiteNewsTitleNewsDao = homeSiteNewsTitleNewsDao;
	}

	/*****
	 * 添加标题新闻
	 */
	public Boolean addHomeSiteNewsTitleNews(HomeSiteNewsTitleNews homeSiteNewsTitleNews)
			throws BusinessException {
		return  this.getHomeSiteNewsTitleNewsDao().addHomeSiteNewsTitleNewsDao(homeSiteNewsTitleNews);
	}

	/****
	 * 删除标题新闻
	 */
	public void deleteHomeSiteNewsTitleNews(HomeSiteNewsTitleNews homeSiteNewsTitleNews)
			throws BusinessException {
		this.getHomeSiteNewsTitleNewsDao().deleteHomeSiteNewsTitleNewsDao(homeSiteNewsTitleNews);

	}

	/****
	 * 通过id,加载标题新闻
	 */
	public HomeSiteNewsTitleNews loadById(Integer id)
			throws BusinessException {
		return  this.getHomeSiteNewsTitleNewsDao().loadByIdDao(id);
	}

	/****
	 * 获取标题新闻列表
	 */
	public PageResultSet loadHomeSiteNewsTitleNewsList(
			AdminNewsTitleNewsForm adminNewsTitleNewsForm)
			throws BusinessException {
		return  this.getHomeSiteNewsTitleNewsDao().loadHomeSiteNewsTitleNewsListDao(adminNewsTitleNewsForm);
	}

	/****
	 * 更新标题新闻
	 */
	public boolean update(HomeSiteNewsTitleNews homeSiteNewsTitleNews)
			throws BusinessException {
		this.getHomeSiteNewsTitleNewsDao().updateDao(homeSiteNewsTitleNews);
		return true;
	}

	/*****
	 * 获取最新的标题新闻
	 */
	public HomeSiteNewsTitleNews loadEndTitleNews(String siteType) throws BusinessException 
	{
		return  this.getHomeSiteNewsTitleNewsDao().loadEndTitleNewsDao(siteType);
	}

	/****
	 * 通过父类的id,获取所有子类的列表
	 */
	public List loadTitleNewsByParentId(Integer id,String siteType) throws BusinessException 
	{
		return  this.getHomeSiteNewsTitleNewsDao().loadTitleNewsByParentId(id, siteType);
	}

}
